package main

import (
	"fmt"
	"bufio"
	"os"
)

func main() {
	//multiplication()
	//var str string
	//fmt.Scanf("%s",&str)
	//if backText(str) {
	//	fmt.Printf("%s是回文\n",str)
	//}else {
	//	fmt.Printf("%s不是回文\n",str)
	//}
	test()
}

func backText(str string) (flag bool){
	flag = false
	array := []rune(str)
	strlen := len(array)
	var newStr string;
	for i,s := range array{
		fmt.Println(string(s))
		newStr += string(array[strlen-i-1:strlen-i])
	}
	fmt.Println(newStr)
	if str == newStr {
		flag = true
	}
	return
}

func multiplication() {
	for i := 1; i <= 9; i++ {
		for j := 1; j <= i; j++ {
			fmt.Printf("%v * %v = %v  ",j,i,i*j)
		}
		fmt.Println()
	}
}

func test(){

	reader := bufio.NewReader(os.Stdin)
	result,_,err := reader.ReadLine()
	if nil != err {
		fmt.Println("read from console err",err)
		return
	}
	fmt.Println(count(string(result)))
}

func count(str string) (worldCount,spaceCount,numberCount, otherCount int){
	t := []rune(str)
	for _,v := range t {
		switch {
		case v >= 'a' && v <= 'z':
			fallthrough
		case v >= 'A' && v <= 'Z':
			worldCount++
		case v >= '0' && v <= '9':
			numberCount++
		case v == ' ':
			spaceCount++
		default:
			otherCount++
		}
	}
	return
}